package pl.surecase.eu;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyDaoGenerator {

    public static void main(String args[]) throws Exception {
        Schema schema = new Schema(1, "com.design.graduation.asdemo.model");
        addNote(schema);
        detailsInfo(schema);
        schema.setDefaultJavaPackageDao("com.design.graduation.asdemo.dao");
        new DaoGenerator().generateAll(schema, "app/src/main/java");

    }

    private static void addNote(Schema schema) {

        Entity test = schema.addEntity("Test");
        test.addLongProperty("keyId").primaryKey();
        test.addStringProperty("title").notNull();
        test.addStringProperty("content").notNull();
        //编辑输入房屋描述界面

        Entity solicitInfo = schema.addEntity("SolicitInfo");
        solicitInfo.addDoubleProperty("lon");
        solicitInfo.addDoubleProperty("lat");
        solicitInfo.addStringProperty("price");

    }

    private static void detailsInfo(Schema schema) {
        Entity detailsInfo = schema.addEntity("DetailsInfo");
        detailsInfo.addStringProperty("position").notNull();
        detailsInfo.addStringProperty("lon");
        detailsInfo.addStringProperty("lat");
        detailsInfo.addStringProperty("number").notNull();
        detailsInfo.addStringProperty("content").notNull();
        detailsInfo.addStringProperty("phone").notNull();
        detailsInfo.addStringProperty("imgUrl").notNull();
    }
}
